package hrx.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

//提供get，set方法
@Data
//提供满参构造方法
@AllArgsConstructor
//提供空参构造方法
@NoArgsConstructor
//该类为JPA实体类，会被JPA识别
@Entity
//指定对应的数据库表名
@Table(name = "user")
public class User {

    //该字段为表的主键
    @Id
    //主键的生成策略为自增
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer user_id;
    private String user_name;
    private String user_password;
    private String user_gender;
    //    星座
    private String constellation;
    //所在学校
    private String school;
    //专业
    private String major;
    //自我介绍
    private String self_introduction;
    private Integer age;

    //余额
    private BigDecimal balance;

    //注册时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date register_time;

    //用户状态
    private Integer user_status;

    private BigDecimal blance;


}
